package com.exercise.core.web.servlet;/**
 * Created by kete on 2017-05-05.
 */

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.servlet.DispatcherServlet;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 作者：kete
 * 创建时间：2017-05-05 15:44
 * 功能描述：
 * 版本：
 */
public class EbiddingDispatcherServlet extends DispatcherServlet {


    protected ServletRequestAttributes buildRequestAttributes(
            HttpServletRequest request, HttpServletResponse response, RequestAttributes previousAttributes) {

        if (previousAttributes == null || previousAttributes instanceof ServletRequestAttributes) {
            return new ServletWebRequest(request,response);
        }
        else {
            return null;  // preserve the pre-bound RequestAttributes instance
        }
    }
}
